The present disclosure relates to a photographing apparatus, a photographing method, a template creation apparatus, a template creation method, and a program. In particular, the present disclosure relates to a photographing apparatus, a photographing method, a template creation apparatus, a template creation method, a program capable of performing tracking and photographing by using an optimal template of a target to be tracked.
An automatic tracking camera is a monitoring camera (PTZ (Pan/Tilt/Zoom) camera) that estimates a position of a target to be tracked which is automatically or manually selected and performs PTZ control in such a manner that the target to be tracked is positioned on the center of a taken image within a predetermined size range.
In such an automatic tracking camera, the target to be tracked typically exists on the center of the taken image, so a surveillant does not have to make a search for a suspicious person, which reduces a burden on the surveillant. Further, it is possible to track the target to be tracked and take an image thereof, so a surveillance possible range per camera is increased. Therefore, it is possible to reduce the number of cameras to be installed and thus reduce cost.
In the automatic tracking camera, as a method of estimating a position of the target to be tracked, there is a first method of obtaining an optical flow from past and current images and setting an area including a movement as the target to be tracked, thereby estimating the position of the target to be tracked. Further, there is a second method of determining a difference between a back ground image of a past image and a current image and setting an area with a larger difference as the target to be tracked, thereby estimating the position of the target to be tracked.
However, if there are a plurality of moving objects, specifying the target to be tracked is difficult by the first and the second methods. In view of this, there has been proposed a third method of learning a feature such as color of the target to be tracked and estimating the position of the target to be tracked on the basis of the feature.
Here, in the case where a surveillant specifies a first position of the target to be tracked, information relating to a first template of the target to be tracked is highly reliable. However, the feature of the target to be tracked varies depending on a posture, brightness, or the like of the target to be tracked. Therefore, in the third method, the feature of the target to be tracked has to be learned in real time.
For example, Japanese Patent No. 5116605 discloses a method of updating a template of the target to be tracked on a frame basis, learning a feature thereof, and estimating the position of the target to be tracked on the basis of the feature. In the method disclosed in Japanese Patent No. 5116605, a particle filter is used for the feature calculated in learning, thereby estimating the position and a size of the target to be tracked. A template (sample) of the target to be tracked which is used for learning is a part of the particle, and a template of a background image is a remaining particle.